package com.zhuangjie.shop.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author zhuangjie
 * @since 2023-10-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("menu")
@ApiModel(value="Menu对象", description="菜单表")
public class Menu implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "菜单id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "上级菜单id")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty(value = "对应前端文件名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "对应前端展示的名称")
    @TableField("label")
    private String label;

    @ApiModelProperty(value = "前端路由router路径")
    @TableField("route")
    private String route;

    @ApiModelProperty(value = "对应前端component")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "菜单图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty(value = "授权(*,admin,employee)")
    @TableField("perms")
    private String perms;

    @ApiModelProperty(value = "状态：1启用，2禁用")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "子菜单列表")
    @TableField(exist = false)
    private List<Menu> childrenMenus;

}
